package com.sxkf.core.third.os;

import com.sxkf.core.third.os.vo.response.UploadFileVO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @Description OS存储Service
 * @Author Eliauk
 * @Date 2023/5/26 4:50 PM
 */
public interface OsService {
    /**
     * 上传文件
     *
     * @param file 文件
     * @return UploadFileVO
     */
    UploadFileVO uploadFile(MultipartFile file) throws IOException;

//    default MultipartFile convertToMultipartFile(BufferedImage bufferedImage, String fileName) throws IOException {
//        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
//        ImageIO.write(bufferedImage, "png", outputStream);
//        byte[] imageBytes = outputStream.toByteArray();
//        ByteArrayInputStream inputStream = new ByteArrayInputStream(imageBytes);
//
//        return new MockMultipartFile(fileName, inputStream);
//    }
}
